import request from '@/utils/request.js'

// 加入购物车
export function addToShoppingCartAPI(data){
  return request({
    method:'POST',
    url:'/member/cart',
    data
  })
}

// 购物车列表
export function getCartListAPI(){
  return request({
    method:'GET',
    url:'/member/cart'
  })
}

// 删除/清空购物车商品
export function deleteCommodityAPI(data){
  return request({
    method:'DELETE',
    url:'/member/cart',
    data
  })
}

// 修改购物车商品
export function updateCartGoodsAPI(data){
  return request({
    method:'PUT',
    url:`/member/cart/${data.id}`,
    data
  })
}

// 购物车全选/取消全选
export function updateAllCheckedAPI(data){
  return request({
    method:'PUT',
    url:'/member/cart/selected',
    data
  })
}